Repository navigation
Test markitdown-ocr in CI against the sibling markitdown - #2378
Merged
Merged
Conversation
Add an ocr-tests job that installs markitdown from the local checkout rather than PyPI, so the plugin is exercised against the sibling package it ships alongside. The docx underline and ZIP filename casing tests depend on fixes that are not in the released 0.1.7, so hatch's env made them fail. Also correct the test_pdf_multipage expectation: pdf_multipage.pdf parses fine on every supported pdfminer.six, so the converter interleaves page text with the OCR blocks rather than falling back to full-page OCR. Includes two unrelated fixes that were already staged: spacing in the --cu-endpoint error message, and skipping the XML round-trip in _pre_process_strike when the document has no dstrike elements. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ntain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The CI matrix omits Python 3.13 despite the package explicitly advertising support for it.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds CI coverage for markitdown-ocr against the sibling markitdown checkout and updates related behavior.
Changes:
- Adds multi-version OCR test CI.
- Updates the multipage PDF snapshot.
- Optimizes DOCX strike preprocessing and fixes CLI error spacing.
File summaries
| File | Description |
|---|---|
.github/workflows/tests.yml |
Adds OCR CI and read-only permissions. |
packages/markitdown-ocr/tests/test_pdf_converter.py |
Updates multipage PDF output expectations. |
packages/markitdown/src/markitdown/converter_utils/docx/pre_process.py |
Skips unnecessary XML processing. |
packages/markitdown/src/markitdown/__main__.py |
Corrects error-message spacing. |
Review details
- Files reviewed: 3/4 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
packages/markitdown-ocrhas never run in CI —tests.ymlonly runscd packages/markitdown; hatch test. Its suite fails 4 of 40 locally,from two causes.
Add an
ocr-testsjob. Three docx failures come from the test envresolving
markitdownfrom PyPI (0.1.7) instead of the sibling checkout(0.1.8b1), which has the underline (#2017) and ZIP casing (#2016) fixes
those tests exercise. The job installs
./packages/markitdownas a localpath so the checkout wins the requirement and nothing comes from PyPI.
Fix a stale
test_pdf_multipagesnapshot. It asserted full-page OCRfallback, on the claim that pdfplumber can't open the file. It can —
pdf_multipage.pdfis valid and opens on every pdfminer.six from 20231228on — so the converter interleaves page text with the OCR blocks. The
expectation now matches that.
Also included, already staged: spacing in the
--cu-endpointerrormessage, and skipping the XML round-trip in
_pre_process_strikewhenthere are no
dstrikeelements.40 passed on Python 3.12; the 3.10/3.11 matrix legs are unverified locally.
Follow-up: this tests the workspace markitdown, not what installers get —
pip install markitdown-ocrstill resolves 0.1.7 and silently drops<u>.The floor should move to
markitdown>=0.1.8once it ships.🤖 Generated with Claude Code